﻿using ScanFile.Dal;
using ScanFile.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bll {
  public partial class FileExBll : BaseBll<FileEx> {

    private FileExDal fileExDal;

    /// <summary>
    /// 构造函数
    /// </summary>
    public FileExBll() {
      fileExDal = new FileExDal();
    }


    public System.Int64 Add(FileEx fileEx) {
      return fileExDal.Add(fileEx,true);
    }

    public System.Int64 InsertList(List<FileEx> fileExList) {
      return fileExDal.AddList(fileExList);
    }

    public List<FileEx> GetListByParentFolder(string folderPathMD5) {
      return fileExDal.GetListByParentFolder(folderPathMD5);
    }


    public List<FileEx> GetListByMd5(string fileMd5) {
      return fileExDal.GetListByMd5(fileMd5);
    }


    public System.Int64 UpdateSameFileCount(FileEx fileEx) {
      return fileExDal.UpdateSameFileCount(fileEx);
    }


    public System.Int64 UpdateEntity(FileEx fileEx) {
      return fileExDal.UpdateById(fileEx,true);
    }


    public FileEx GetFileExByFullPath(string fileFullPath) {
      return fileExDal.GetFileExByFullPath(fileFullPath);

    }

    public FileEx GetFileExByPathMd5(string pathMd5) {
      return fileExDal.GetFileExByPathMd5(pathMd5);

    }

    public System.Int64 DeleteFileExByPathMd5(string pathMd5) {
      return fileExDal.DeleteFileExByPathMd5(pathMd5);
    }

    public System.Int64 DeleteOrphanFileEx(string folderFullName) {
      return fileExDal.DeleteOrphanFolderEx(folderFullName);
    }

    public List<FileEx> GetSameFiles() {
      return fileExDal.GetSameFiles();
    }
  }
}
